﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Display.aspx.cs" Inherits="Secondhand_Book_Trade.Display" %>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <title>详情</title>
    <!-- Bootstrap 5 CSS -->
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css" rel="stylesheet" />
    <style>
        .center-panel {
            margin: 0 270px;
        }
       .detail-gradient {
            background: linear-gradient(90deg, #e6f7ff 0%, #b3e5fc 100%);
            border-radius: 16px;
            padding: 32px 24px;
            margin: 32px auto;
            max-width: 900px;
            box-shadow: 0 2px 12px rgba(0,0,0,0.08);
        }
        .book-detail-row {
            display: flex;
            align-items: flex-start;
            gap: 32px;
        }
        .detail-img {
            width: 220px;
            height: 280px;
            object-fit: cover;
            border-radius: 8px;
            box-shadow: 0 1px 8px rgba(0,0,0,0.08);
        }
        .detail-info {
            flex: 1;
        }
        .detail-title {
            font-size: 2em;
            font-weight: bold;
            margin-bottom: 16px;
        }
        .detail-price {
            font-size: 1.5em;
            color: #e74c3c;
            margin-bottom: 16px;
        }
        .detail-actions button {
            margin-right: 12px;
        }
        .section-title {
            display: inline-block;
            background: linear-gradient(90deg, #0D6EFD 0%, #e0e7ef 100%);
            border-radius: 8px;
            padding: 4px 16px;
            margin-bottom: 12px;
            margin-top: 12px;
            font-weight: bold;
            box-shadow: 0 1px 4px rgba(0,0,0,0.04);
        }
        .buyer-notice, .book-desc, .comments-section {
            margin-top: 32px;
            padding: 24px 18px;
            border-radius: 10px;
            background: linear-gradient(90deg, #fff7e6 0%, #ffe0b2 100%);
        }
    </style>
    <script>
        // 登录判断弹窗
        function requireLogin() {
            alert("请先登录后再进行此操作！");
            return false;
        }
    </script>
</head>
<body>
    <form id="form1" runat="server">
        <div>
            <nav class="navbar navbar-expand-lg navbar-dark bg-primary">
                <div class="container">
                    <a class="navbar-brand" href="#">高校二手书平台</a>
                    <button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarNav">
                        <span class="navbar-toggler-icon"></span>
                    </button>
                    <div class="collapse navbar-collapse" id="navbarNav">
                        <ul class="navbar-nav me-auto">
                            <li class="nav-item">
                                <a class="nav-link active" href="Index.aspx">首页</a>
                            </li>
                            <li class="nav-item">
                                <a class="nav-link" href="#">二手书列表</a>
                            </li>
                            <li class="nav-item">
                                <a class="nav-link" href="#">订单查询</a>
                            </li>
                            <li class="nav-item">
                                <a class="nav-link" href="#">用户留言</a>
                            </li>
                        </ul>
                        <ul class="navbar-nav">
                            <li class="nav-item">
                                <a class="nav-link" href="Login.aspx">用户登录</a>
                            </li>
                            <li class="nav-item">
                                <a class="nav-link" href="AdminDashboard.aspx">后台登录</a>
                            </li>
                        </ul>
                    </div>
                </div>
            </nav>
            <div class="main-container">
                <div class="center-panel">
                        <h5 class="section-title">二手书详情</h5>
                </div>
            </div>

            <div class="detail-gradient">
                <div class="book-detail-row">
                    <img id="imgBook" runat="server" class="detail-img" />
                    <div class="detail-info">
                        <div class="detail-title" id="lblTitle" runat="server"></div>
                        <div class="detail-price" id="lblPrice" runat="server"></div>
                        <div class="detail-actions">
                            <asp:Button ID="btnFavorite" runat="server" Text="收藏" CssClass="btn btn-outline-primary" OnClick="btnFavorite_Click" />
                            <asp:Button ID="btnComment" runat="server" Text="评论" CssClass="btn btn-outline-success" OnClick="btnComment_Click" />
                            <asp:Button ID="btnBuy" runat="server" Text="购买" CssClass="btn btn-danger" OnClick="btnBuy_Click" />
                        </div>
                    </div>
                </div>
                <div class="buyer-notice mt-4">
                    <span class="section-title">买家必读</span>
                    <div class="mt-2">
                        平邮:7-15天,邮费7.0元,送货上门<br />
                        快邮:4-10天,邮费10.0元,送货上门<br />
                        快递:2-4天,邮费15.0元,送货上门<br />
                        EMS:当日，邮费25.0元,送货上门
                    </div>
                </div>
                <div class="book-desc mt-4">
                    <span class="section-title">详情介绍</span>
                    <div class="mt-2" id="lblDescription" runat="server"></div>
                </div>
                <div class="comments-section mt-4">
                    <span class="section-title">评论信息</span>
                    <asp:Repeater ID="rptComments" runat="server">
                        <ItemTemplate>
                            <div class="border-bottom py-2">
                                <strong><%# Eval("Username") %></strong>：
                                <span><%# Eval("Comment") %></span>
                                <span class="text-muted ms-2" style="font-size:0.9em;"><%# Eval("ReviewTime", "{0:yyyy-MM-dd HH:mm}") %></span>
                            </div>
                        </ItemTemplate>
                    </asp:Repeater>
                </div>
             </div>
        </div>
    </form>
    <!-- Bootstrap 5 JS Bundle with Popper -->
    <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/js/bootstrap.bundle.min.js"></script>
</body>
</html>
